package com.xy.entity.Coupon;

import com.xy.common.jpa.AbstractTimestampEntity;
import com.xy.entity.User;


import com.xy.entity.msg.AccountMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


import javax.persistence.*;
import java.math.BigDecimal;

import java.util.HashSet;
import java.util.List;
import java.util.Set;


/**
 * Created with IntelliJ IDEA.
 * Description:优惠券表
 * Date: 2018-01-20
 * Time: 12:28
 */
@Entity
@Data
@Table(name = "coupon")

public class Coupon extends AbstractTimestampEntity{

    @ApiModelProperty(value="金额",name="money")
    private String money;
    @ApiModelProperty(value="开始时间",name="time")
    private int  startTime;
    @ApiModelProperty(value="结束时间",name="time")
    private int  endTime;
    @ApiModelProperty(value="满减",name="sums")
    private BigDecimal sum;
    @ApiModelProperty(value="优惠券说明",name="explain")
    private String explains;

   @OneToMany(mappedBy = "coupon", cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Set<AccountMsg> accountMsgs = new HashSet<>();

}
